package com.ys.nms.module.business.dal.mysql.ipv4Addresses;

import java.util.*;

import com.ys.nms.framework.common.pojo.PageResult;
import com.ys.nms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ys.nms.framework.mybatis.core.mapper.BaseMapperX;
import com.ys.nms.module.business.dal.dataobject.ipv4Addresses.Ipv4AddressesDO;
import org.apache.ibatis.annotations.Mapper;
import com.ys.nms.module.business.controller.admin.ipv4Addresses.vo.*;

/**
 * IP地址 Mapper
 *
 * @author zzi
 */
@Mapper
public interface Ipv4AddressesMapper extends BaseMapperX<Ipv4AddressesDO> {

    default PageResult<Ipv4AddressesDO> selectPage(Ipv4AddressesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<Ipv4AddressesDO>()
                .eqIfPresent(Ipv4AddressesDO::getIpv4Address, reqVO.getIpv4Address())
                .eqIfPresent(Ipv4AddressesDO::getIpv4Prefixlen, reqVO.getIpv4Prefixlen())
                .eqIfPresent(Ipv4AddressesDO::getIpv4NetworkId, reqVO.getIpv4NetworkId())
                .eqIfPresent(Ipv4AddressesDO::getPortId, reqVO.getPortId())
                .orderByDesc(Ipv4AddressesDO::getIpv4AddressId));
    }

}